import type { App } from 'vue'
import 'element-plus/dist/index.css'
import {
  ElButton,
  ElTabPane,
  ElTabs,
  ElCheckbox,
  ElLink,
  ElForm,
  ElFormItem,
  ElInput,
  ElMenu,
  ElMenuItem,
  ElSubMenu
} from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue' // element-plus 图标

const commponents = [
  ElButton,
  ElTabPane,
  ElTabs,
  ElCheckbox,
  ElLink,
  ElForm,
  ElFormItem,
  ElInput,
  ElMenu,
  ElMenuItem,
  ElSubMenu
]

export default function (app: App): void {
  for (const cpn of commponents) {
    app.component(cpn.name, cpn)
  }
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
}
